<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript">
<!--
function doSelectScl(obj){
	$("#scl_lk_sclName").val($("#scl_name_"+obj.rowIndex).attr("rel"));
	$("#scl_lk_sclId").val($("#scl_name_"+obj.rowIndex).attr("rel2"));
}
//-->
</script>
<form id="pagerForm" action="#rel#">
	<input type="hidden" name="pageNum" value="${currentPage }" />
	<input type="hidden" name="numPerPage" value="${numPerPage}" />
	<input type="hidden" name="orderField" value="${param.orderField}" />
	<input type="hidden" name="orderDirection" value="${param.orderDirection}" />
</form>

<div class="pageHeader">
	<form rel="pagerForm" method="post" action="school_lookup.action" onsubmit="return dwzSearch(this, 'dialog');">
	<div class="searchBar">
		<table class="searchContent" border="0">
			<tr>
				<%-- <td>
					<label>地区：</label>
					<select
						name="areaCode" 
						class="combox">
						<option value="">---所有地区---</option>
						<c:forEach items="${areaList}" var="area">
							<option ${areaCode==area.areaCode?"selected":""}  value="${area.areaCode }">${area.areaName}</option>
						</c:forEach>
					</select>
				</td> --%>
				<td width="28%">
				<label>所属市：</label>
				<select
					name="areaCode" 
					class="combox" id="lookup_areaCode" ref="lookup_county" refUrl="school_getAreaByCity.action?areaCode={value}">
					<option value="">---所有地区---</option>
					<c:forEach items="${application.areaList}" var="area">
						<option ${areaCode==area.areaCode?"selected":""}  value="${area.areaCode }">${area.areaName}</option>
					</c:forEach>
				</select>
				</td>
				<td width="28%">
				<label>所属区县：</label>
				<select
					name="countyCode" 
					class="combox" id="lookup_county">
					<option value="">---所有区县---</option>
					<c:forEach items="${countyList}" var="area">
						<option ${countyCode==area.areaCode?"selected":""}  value="${area.areaCode }">${area.areaName}</option>
					</c:forEach>
				</select>
				</td>
				<td width="24%">
					<label>学校名称：</label>
					<input type="hidden" id="scl_lk_sclId" name="sclId"  value="${sclId}" maxlength="20" />
					<input type="text" id="scl_lk_sclName" name="sclName"  value="${sclName}" maxlength="20"/>
				</td>
				<td width="5%">
					<div class="buttonActive">
						<div class="buttonContent">
							<button type="submit">检索</button>
						</div>
					</div>
				</td>
				<td width="5%">
					<div class="buttonActive">
						<div class="buttonContent">
							<button 
								type="button" 
								onclick="javascript:$.bringBack({sclId:$('#scl_lk_sclId').val(),sclName:$('#scl_lk_sclName').val()})">
								确定
							</button>
						</div>
					</div>
				</td>
			</tr>
		</table>
	</div>
	</form>
</div>
<div class="pageContent">
	<table class="table" layoutH="90" targetType="dialog" width="100%">
		<thead>
			<tr>
				<th orderfield="orgName">地区</th>
				<th orderfield="orgNum">学校名称</th>
				<th orderfield="creator">拼音码</th>
				<!-- 
				<th width="80">查找带回</th>
				 -->
			</tr>
		</thead>
		<tbody>
			<c:forEach var="school" items="${recordList}" varStatus="status">
			<tr id="scl_name_${status.index }" onclick="doSelectScl(this)" target="scl_name" rel="${school.sclName }" rel2="${school.sclId }" >
				<td>
					<c:forEach items="${areaList}" var="area">
						<c:if test="${school.areaCode==area.areaCode }">${area.areaName }</c:if>
					</c:forEach>
 				</td>
				<td>${school.sclName }</td>
				<td>${school.sclSpell }</td>
				<%--
				<td>
					<a class="btnSelect" href="javascript:$.bringBack({id:'${(status.index+1) }', sclName:'${school.sclName }'})" title="查找带回">选择</a>
				</td>
				 --%>
			</tr>
			</c:forEach>
		</tbody>
	</table>

	<div class="panelBar">
		
		<div class="pages">
			<span>页次&nbsp;${currentPage }&nbsp;/&nbsp;${pageCount }&nbsp;页，</span>
			<span>显示&nbsp;</span>
			<select class="combox" name="numPerPage"
				onchange="dwzPageBreak({targetType:dialog, numPerPage:'10'})">
				<option ${numPerPage==10?"selected":"" } value="10">10</option>
				<%--
				<option ${numPerPage==20?"selected":"" } value="20">20</option>
				<option ${numPerPage==50?"selected":"" } value="50">50</option>
				<option ${numPerPage==100?"selected":"" } value="100">100</option>
				 --%>
			</select>
			<span>&nbsp;条，共${recordCount}条</span>
		</div>
		
		<div class="pagination" targetType="dialog" totalCount="${recordCount}" numPerPage="${pageSize}" pageNumShown="${pageNumShown}"
		currentPage="${currentPage }"></div>
		
	</div>
</div>